package com.eunion.core.common.jpa.deletgate;

import java.io.Serializable;
import java.lang.reflect.Method;
import java.util.Set;

import org.springframework.data.repository.core.CrudMethods;
import org.springframework.data.repository.core.RepositoryInformation;
import org.springframework.util.Assert;

public class ProjectionRepositoryInformation implements RepositoryInformation {

    private final RepositoryInformation delegate;

    private Class<?> beanClass;

    public ProjectionRepositoryInformation(RepositoryInformation delegate) {
        Assert.notNull(delegate, "Delegated object must not be null!");
        this.delegate = delegate;
    }

    public Class<?> getBeanClass() {
        return beanClass;
    }

    public void setBeanClass(Class<?> beanClass) {
        this.beanClass = beanClass;
    }

    public Class<?> getRepositoryBaseClass() {
        return delegate.getRepositoryBaseClass();
    }

    public Class<? extends Serializable> getIdType() {
        return delegate.getIdType();
    }

    public boolean hasCustomMethod() {
        return delegate.hasCustomMethod();
    }

    public Class<?> getDomainType() {
        return delegate.getDomainType();
    }

    public boolean isCustomMethod(Method method) {
        return delegate.isCustomMethod(method);
    }

    public Class<?> getRepositoryInterface() {
        return delegate.getRepositoryInterface();
    }

    public boolean isQueryMethod(Method method) {
        return delegate.isQueryMethod(method);
    }

    public Class<?> getReturnedDomainClass(Method method) {
        return delegate.getReturnedDomainClass(method);
    }

    public boolean isBaseClassMethod(Method method) {
        return delegate.isBaseClassMethod(method);
    }

    public CrudMethods getCrudMethods() {
        return delegate.getCrudMethods();
    }

    public Iterable<Method> getQueryMethods() {
        return delegate.getQueryMethods();
    }

    public boolean isPagingRepository() {
        return delegate.isPagingRepository();
    }

    public Method getTargetClassMethod(Method method) {
        return delegate.getTargetClassMethod(method);
    }

    public Set<Class<?>> getAlternativeDomainTypes() {
        return delegate.getAlternativeDomainTypes();
    }
}
